<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@page import="com.lmpop.trade.ti_finance.*" %>
<%@page import="java.util.*" %>
<%@page import="com.lmpop.frame.util.PageTools" %>
<%@page import="com.lmpop.trade.ti_finance_history.*" %>

<%
	request.setCharacterEncoding("UTF-8");
	Map ti_finance = new Hashtable();
	String session_cust_id="";
	if(session.getAttribute("session_cust_id")!=null){
	  session_cust_id=session.getAttribute("session_cust_id").toString(); 
	}
//out.print(session_cust_id);		
	Ti_financeInfo ti_financeInfo = new Ti_financeInfo();
	String iStart = "0";
	int limit = 20;
	if(request.getParameter("iStart")!=null) iStart = request.getParameter("iStart");
	List list = ti_financeInfo.getListByPk(session_cust_id);
	Hashtable mapp = new Hashtable();
  	if(list!=null && list.size()>0) mapp = (Hashtable)list.get(0);
	String cust_idd=session_cust_id,vmoney="0",use_vmoney="",frz_vmoney="",inter="",use_inter="",frz_inter="",remarkk="";
	String cust_name = "";
	if(mapp.get("cust_idd")!=null) cust_idd = mapp.get("cust_idd").toString();
	if(mapp.get("vmoney")!=null) vmoney = mapp.get("vmoney").toString();
	if(mapp.get("inter")!=null) inter = mapp.get("inter").toString();
	
	Map ti_finance_history = new Hashtable();
	ti_finance_history.put("cust_id",session_cust_id);
	ti_finance_history.put("type","0");
	Ti_finance_historyInfo ti_finance_historyInfo = new Ti_finance_historyInfo();
	List listt = ti_finance_historyInfo.getListByPage(ti_finance_history,Integer.parseInt(iStart),limit);	
	int counter = ti_finance_historyInfo.getCountByObj(ti_finance_history);
	String pageString = new PageTools().getGoogleToolsBar(counter,"index.jsp?iStart=",Integer.parseInt(iStart),limit);
%>
<html>
  <head>
    
    <title>会员积分管理</title>
	<link href="/program/company/index/css/style.css" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="/js/commen.js"></script>
	<script type="text/javascript" src="inter.js"></script>
</head>

<body>
	<table width="100%" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td width="90%">
				<h1>会员积分管理</h1>
			</td>
		</tr>
	</table>
	<table width="100%" align="center" cellpadding="0" cellspacing="0" class="dl_so">
        <tr>
          <td width="9%" align="center"><img src="/program/admin/index/images/ban_01.gif" /></td>
          <td width="91%" align="left">
		  <span>您的积分总数为：<%=inter%></span>
		  </td>
        </tr>
      </table>
	
	<form action="index.jsp" name="indexForm" method="post">

	<table width="100%" cellpadding="0" cellspacing="0" border="0" class="tablehe">
		<tr><td><%=pageString %></td></tr>
	</table>
	
	<% 
		int listsize = 0;
		if(listt!=null && listt.size()>0){
			listsize = listt.size();
	%>
	
	<table width="100%" cellpadding="0" cellspacing="0" border="0" class="dl_bg">
		<tr>
			<td width="90%">
			
			</td>
			<td>
				总计:<%=counter %>条
			</td>
		</tr>
	</table>
	
	<table width="100%" cellpadding="1" cellspacing="1" class="listtab" border="0">
		<tr>
	  	
		  	<th>异动积分</th>

			<th>异动原因</th>
			
		  	<th>异动时间</th>
		  	
		</tr>
		
		<% 
		  		for(int i=0;i<listt.size();i++){
		  			Hashtable map = (Hashtable)listt.get(i);
		  			String trade_id="",cust_id="",num="",vtype="",reason="",in_date="",user_id="",remark="";
		  			  	if(map.get("trade_id")!=null) trade_id = map.get("trade_id").toString();
						if(map.get("cust_id")!=null) cust_id = map.get("cust_id").toString();
						if(map.get("num")!=null) num = map.get("num").toString();
						if(map.get("type")!=null) vtype = map.get("type").toString();
						if(map.get("reason")!=null) reason = map.get("reason").toString();
						if(map.get("in_date")!=null) in_date = map.get("in_date").toString();
						if(in_date.length()>19)in_date=in_date.substring(0,19);
						if(map.get("user_id")!=null) user_id = map.get("user_id").toString();
						if(map.get("remark")!=null) remark = map.get("remark").toString();

		  %>
		
		<tr>
	        <td><%=num%></td>
		  	
			<td><%=reason%></td>

		  	<td><%=in_date%></td>
		</tr>
		  <%
		  		}
		  %>
	</table>
	
	<table width="100%" cellpadding="0" cellspacing="0" border="0" class="dl_bg">
		<tr>
			<td width="90%">
				
			</td>
			<td>
				总计:<%=counter %>条
			</td>
		</tr>
	</table>
	<table width="100%" cellpadding="0" cellspacing="0" border="0" class="tablehe">
		<tr><td><%=pageString %></td></tr>
	</table>
	<%
		 }
	%>
	<input type="hidden" name="listsize" id="listsize" value="<%=listsize %>" />
	<input type="hidden" name="pkid" id="pkid" value="" />
	<input type="hidden" name="bpm_id" id="bpm_id" value="0099" />
	</form>
</body>
</html>
